package com.njtoyo.taxi.admin.mapper.master.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.njtoyo.taxi.admin.library.Const;
import com.njtoyo.taxi.admin.mapper.master.entity.ActivitySeckillWinningPrize;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Dell
 * @since 2021-07-01
 */
@Repository
@DS(Const.PRIMARY_DS)
public interface ActivitySeckillWinningPrizeMapper extends BaseMapper<ActivitySeckillWinningPrize> {

    @Select("SELECT COUNT(*) FROM activity_seckill_winning_prize WHERE prize_id IN (SELECT id FROM activity_seckill_prize WHERE activity_award_id = #{awardId})")
    Long selectCountByAwardId(@Param("awardId") Long awardId);
}
